<template>
  <div class="exhibits-content" :style="{ width: props.info.width + 'rem', height: props.info.height + 'rem' }">
    <div class="list">
      <div
        class="list-content-left"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style14/exhibitionStandStyle1BgLeft.webp'})`,
        }"
      ></div>
      <div class="list-content">
        <div
          class="exhibits-item"
          @contextmenu.stop="emit('onContextMenuChild', $event, index)"
          v-for="(item, index) in props.info.showpieceList"
          :key="index"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style14/exhibitionStandStyle1Bg.webp'})`,
          }"
        >
          <div class="cover-box" @click="viewImg(item.moduleId, item.id)">
            <img class="cover" v-lazy="getLinkUrl(item.coverUrl, '?imageView2/3/w/600/format/webp')" alt="" />
            <img
              v-if="route.meta.loopType"
              class="flower-btn"
              v-lazy="publicUrls + 'free/style2/flower.webp'"
            />
          </div>
          <div class="item-title">
            <div class="title-content">{{ item.name }}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({
  name: 'free14Style1',
});
</script>
<script lang="ts" setup>
import FlowerCom from '../../displayBoard/style12/flower.vue';
import { publicUrls } from '@/utils/minxin';
import { DraggableContainer } from 'vue3-draggable-resizable';
// import FlotMenu from '@/components/flotMenu/OutlineMenu.vue';
import ContextMenu from '@imengyu/vue3-context-menu';
import { getDraggableNumber, getExhibitsHeightRest, getdisabledY } from '@/utils/getRemComputed';
import { ref, reactive, watch, nextTick } from 'vue';
import { exbitMenuShow, exbitListMenuShow } from '@/hooks/menuHooks';
import { useProjectStore } from '@/store';
import { getLinkUrl } from '@/utils/request/upload';
import { useRoute } from 'vue-router';

const emit = defineEmits([
  'emitChildItemDraggable',
  'emitChildItemDraggableStyle',
  'emitShowcaseDraggable',
  'emitShowcaseDraggableStyle',
  'onContextMenuChild',
]);
const route = useRoute();
const store = useProjectStore();
const contextMenuTrigger = ref(); //列表盒子dom
const parentLock = ref(true);
const childShow = ref(true);
const draggableResizable = ref(); //父级拖拽盒子ref
const timer = ref();
const ImgVisible = ref(false);
const ImgUrl = ref('');

const props = defineProps({
  width: {
    type: Number || String,
  },
  height: {
    type: Number || String,
  },
  indexs: {
    type: Number,
  },
  info: {
    type: Object,
  },
  childId: {
    type: Number,
  },
  AuxiliaryId: {
    type: Number,
  },
});

const viewImg = (moduleId: number, e?: number) => {
  store.exhibitsModuleId = moduleId;
  store.exhibitsShowpieceid = e;
  store.exhibitsInfoShow = true;
};

const handleMouseDown = (event) => {
  event.stopPropagation();
};
const preventDefaultDrag = (event) => {
  event.stopPropagation();
};
</script>

<style lang="less" scoped>
.exhibits-content {
  position: relative;
  display: flex;
  z-index: 999;
}
.list {
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 100%;
  padding: 0.05rem;
}
.list-content-left {
  flex-shrink: 0;
  width: 113px;
  height: 624px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  margin-bottom: 42px;
}
.list-content {
  display: flex;
  align-items: flex-end;
  flex-shrink: 0;
}
.exhibits-item {
  flex-shrink: 0;
  position: relative;
  width: 368px;
  height: 720px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  margin-right: 40px;
}
.exhibits-item:last-child {
  margin-right: 0px;
}
.exhibits-item:nth-child(2n) {
  margin-bottom: 78px;
}
.cover-box {
  position: absolute;
  left: 65px;
  bottom: 60px;
  width: 228px;
  height: 364px;
  overflow: hidden;
}
.cover {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: all 0.5s;
}
.exhibits-item:hover {
  .cover {
    transform: scale(1.2);
  }
}
.flower-btn {
  width: 50px !important;
  height: 50px !important;
  object-fit: cover !important;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: flower 2s linear infinite;
  @keyframes flower {
    0% {
      opacity: 0;
    }
    40% {
      opacity: 100%;
    }
    60% {
      opacity: 100%;
    }
    100% {
      opacity: 0;
    }
  }
}
.item-title {
  width: 232px;
  height: 40px;
  position: absolute;
  left: 63px;
  top: 215px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.title-content {
  width: 180px;
  color: #20b3ba;
  text-align: center;
  text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.25);
  -webkit-text-stroke-width: 0.3px;
  -webkit-text-stroke-color: #d4bb8f;
  font-family: 'SourceHanSerifCN';
  font-size: 18px;
  font-style: normal;
  font-weight: 400;
  line-height: 180%; /* 32.4px */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
</style>
